package cn.brilliantfuture.commentry.entity;

// Generated 2012-6-27 17:18:45 by Hibernate Tools 3.3.0.GA

import static javax.persistence.GenerationType.IDENTITY;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.validator.Length;
import org.hibernate.validator.NotNull;

/**
 * WorkflowInfo generated by hbm2java
 */
@Entity
@Table(name = "workflow_info", catalog = "cabinet")
public class WorkflowInfo implements java.io.Serializable {

	private static final long serialVersionUID = 1L;
	private Integer workflowInfoId;
	private OrderInformation orderInformation;
	private int workflowIndex = 0; //自然顺序
	//1为；2为接收配送单；3为备货完成；4为打印配送条形码；5为发送预告信息；
	//6为配送在途；7为完成送货；8为发送取货信息；9为完成取货
	private int workflowType = 0; //流程类型
	private String content; //流程描述
	private Date workflowTime;
	private String operator;
	private Date insertTime = new Date();
	private int insertModel = 0;
	private Date updateTime;
	private Integer updateUser;
	private boolean deleted = false;

	public WorkflowInfo() {
		
	}

	public WorkflowInfo(OrderInformation orderInformation, int workflowIndex, int workflowType, String content, Date workflowTime, String operator, Date insertTime, int insertModel, boolean deleted) {
		this.orderInformation = orderInformation;
		this.workflowIndex = workflowIndex;
		this.workflowType = workflowType;
		this.content = content;
		this.workflowTime = workflowTime;
		this.operator = operator;
		this.insertTime = insertTime;
		this.insertModel = insertModel;
		this.deleted = deleted;
	}

	public WorkflowInfo(OrderInformation orderInformation, int workflowIndex, int workflowType, String content, Date workflowTime, String operator, Date insertTime, int insertModel, Date updateTime, Integer updateUser, boolean deleted) {
		this.orderInformation = orderInformation;
		this.workflowIndex = workflowIndex;
		this.workflowType = workflowType;
		this.content = content;
		this.workflowTime = workflowTime;
		this.operator = operator;
		this.insertTime = insertTime;
		this.insertModel = insertModel;
		this.updateTime = updateTime;
		this.updateUser = updateUser;
		this.deleted = deleted;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "workflow_info_id", unique = true, nullable = false)
	public Integer getWorkflowInfoId() {
		return this.workflowInfoId;
	}

	public void setWorkflowInfoId(Integer workflowInfoId) {
		this.workflowInfoId = workflowInfoId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "order_information_id", nullable = false)
	public OrderInformation getOrderInformation() {
		return this.orderInformation;
	}

	public void setOrderInformation(OrderInformation orderInformation) {
		this.orderInformation = orderInformation;
	}

	@Column(name = "workflow_index", nullable = false)
	public int getWorkflowIndex() {
		return this.workflowIndex;
	}

	public void setWorkflowIndex(int workflowIndex) {
		this.workflowIndex = workflowIndex;
	}

	@Column(name = "workflow_type", nullable = false)
	public int getWorkflowType() {
		return this.workflowType;
	}

	public void setWorkflowType(int workflowType) {
		this.workflowType = workflowType;
	}

	@Column(name = "content", nullable = false, length = 200)
	@NotNull
	@Length(max = 200)
	public String getContent() {
		return this.content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "workflow_time", nullable = false, length = 19)
	@NotNull
	public Date getWorkflowTime() {
		return this.workflowTime;
	}

	public void setWorkflowTime(Date workflowTime) {
		this.workflowTime = workflowTime;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "insert_time", nullable = false, length = 19)
	@NotNull
	public Date getInsertTime() {
		return this.insertTime;
	}

	public void setInsertTime(Date insertTime) {
		this.insertTime = insertTime;
	}

	@Column(name = "insert_model", nullable = false)
	public int getInsertModel() {
		return this.insertModel;
	}

	public void setInsertModel(int insertModel) {
		this.insertModel = insertModel;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "update_time", length = 19)
	public Date getUpdateTime() {
		return this.updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	@Column(name = "update_user")
	public Integer getUpdateUser() {
		return this.updateUser;
	}

	public void setUpdateUser(Integer updateUser) {
		this.updateUser = updateUser;
	}

	@Column(name = "deleted", nullable = false)
	public boolean getDeleted() {
		return this.deleted;
	}

	public void setDeleted(boolean deleted) {
		this.deleted = deleted;
	}

	@Column(name = "operator", nullable = false, length = 50)
	@NotNull
	@Length(max = 50)
	public String getOperator() {
		return operator;
	}

	public void setOperator(String operator) {
		this.operator = operator;
	}

}
